﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using RuleCode.Table;
namespace map.member.order
{
    public partial class buy_15 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                bind1();
            }
        }
        private void bind1()
        {
            taobaotrade t = taobaotrade.Find(" buyer_nick = '"
                + AliApi.appUserId + "' and taobaobuyer_rate!='true'");
            WebPager1.DataSource = t.MyTable;
            WebPager1.DataBind();
            //GridView1.DataSource = t.MyTable;
            //GridView1.DataBind();
        }

        protected void WebPager1_PageIndexChanged(object sender, RuleCode.Controls.PageChangedEventArgs e)
        {
            WebPager1.CurrentPageIndex = e.NewPageIndex;
            bind1();
        }

        /// <summary>
        /// 获取评价状态                            
        /// </summary>
        /// <param name="seller_rate"></param>
        /// <param name="buyer_rate"></param>
        /// <returns></returns>
        protected string GetRateStr(string seller_rate, string buyer_rate)
        {
            string result = string.Empty;
            if (seller_rate == "true")
            {
                if (buyer_rate == "true")
                {
                    result = TRADE_RATE_STATUS.Both_Rate;
                }
                else
                {
                    result = TRADE_RATE_STATUS.Seller_Rate;
                }
            }
            else
            {
                if (buyer_rate == "true")
                {
                    result = TRADE_RATE_STATUS.Buyer_Rate;
                }
                else
                {
                    result = TRADE_RATE_STATUS.None_Rate;
                }
            }
            return result;
        }
    }
}
